<div class="layui-fluid" >
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="addForm">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color: red">*</span>下拉框</label>
                    <div class="layui-input-block">
                        <select id="family"></select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color: red">*</span>选中下拉框</label>
                    <div class="layui-input-block">
                        <select id="family1"></select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color: red">*</span>表格下拉</label>
                    <div class="layui-input-block">
                        <input type="text" id="realName" name="realName" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">富文本</label>
                    <div class="layui-input-block">
                        <textarea id="test"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <a class="layui-btn layui-btn-primary" id="close">关闭</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script>
    var Test = function (index) {
        var admin = layui.admin,
            form = layui.form,
            $ =layui.jquery,
            tinymce =layui.tinymce;
        //初始化
        this.init = function () {
            //家庭成员
            admin.select('#family','FAMILY_REL');
            admin.select('#family1','FAMILY_REL','001');
            var tableSelect = layui.tableSelect;
            //引入组件
            tinymce.render({
                elem: "#test"
                , height: 600
                , width:'100%'
            });

            tableSelect.render({
                elem: '#realName',
                checkedKey: 'id',
                table: {
                    url: 'https://lolicode.gitee.io/layui_component_tableselect/table.json',
                    cols: [[
                        { type: 'radio' },
                        { field: 'id', title: 'ID' },
                        { field: 'username', title: '姓名' },
                        { field: 'sex', title: '性别' }
                    ]]
                },
                done: function (elem, data) {
                    var NEWJSON = []
                    layui.each(data.data, function (index, item) {
                        NEWJSON.push(item.username)
                    })
                    elem.val(NEWJSON.join(","))
                }
            })
            //关闭窗口
            $("#close").click(function () {
                parent.layer.close(index);
                /*admin.popup({
                    title:'新增用户',
                    url:'/sys/news/add',
                    area: ['50%', '50%'], //宽高
                    success:function (layer,index) {

                    }
                });*/
            });
        };
    };

</script>